package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._0._0封装;

/**
 * @ClassName Dog
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/9 7:00 PM
 * @Version 1.0
 */
public class Dog {
    private String name;
    private int shoutNum = 3;

    public Dog(String name) {
        this.name = name;
    }

    public Dog() {
        this.name = "无名";
    }

    public void setShoutNum(int shoutNum) {
        this.shoutNum = shoutNum;
    }

    public int getShoutNum() {
        return this.shoutNum;
    }

    public String shout() {
        String result = "";
        for (int i = 0; i < shoutNum; i++) {
            result += "汪";
        }
        return "我的名字叫" + name + " " + result;
    }
}
